package com.yili.oa.dao.extend;

import com.yili.oa.dao.FtBetRecordMapper;
import com.yili.oa.entity.FtBetRecordSearch;
import com.yili.oa.vo.response.AccountStatisticsRes;
import com.yili.oa.vo.response.FtBetRecordRes;
import com.yili.oa.vo.special.FtBetRecordSpec;
import org.apache.ibatis.annotations.*;
import org.apache.ibatis.type.JdbcType;

import java.math.BigDecimal;
import java.util.Date;
import java.util.List;

public interface FtBetRecordExtendMapper extends FtBetRecordMapper {

    @SelectProvider(type=FtBetRecordExtendSqlProvider.class, method="get")
    @Results({
            @Result(column="id", property="id", jdbcType=JdbcType.BIGINT, id=true),
            @Result(column="create_time_utc", property="createTimeUtc", jdbcType=JdbcType.BIGINT),
            @Result(column="bet_no", property="betNo", jdbcType=JdbcType.VARCHAR),
            @Result(column="bet_amount", property="betAmount", jdbcType=JdbcType.DECIMAL),
            @Result(column="pie_awarded", property="pieAwarded", jdbcType=JdbcType.DECIMAL),
            @Result(column="payout_time_utc", property="payoutTimeUtc", jdbcType=JdbcType.BIGINT),
            @Result(column="game_kind", property="gameKind", jdbcType=JdbcType.INTEGER),
            @Result(column="game_platform", property="gamePlatform", jdbcType=JdbcType.INTEGER),
            @Result(column="game_id", property="gameId", jdbcType=JdbcType.INTEGER),
            @Result(column="user_id", property="userId", jdbcType=JdbcType.BIGINT),
            @Result(column="game_name", property="gameName", jdbcType=JdbcType.VARCHAR),
            @Result(column="pieTime", property="pieTime", jdbcType=JdbcType.VARCHAR),
            @Result(column="betTime", property="betTime", jdbcType=JdbcType.VARCHAR),
    })
    List<FtBetRecordRes> get(FtBetRecordSearch searchBase);


    @SelectProvider(type=FtBetRecordExtendSqlProvider.class, method="getAccountStatistics")
    AccountStatisticsRes getAccountStatistics(FtBetRecordSearch searchBase);

    @SelectProvider(type=FtBetRecordExtendSqlProvider.class, method="getRewardRecord")
    @Results({
            @Result(column="BETSUM", property="betAmount", jdbcType=JdbcType.DECIMAL),
            @Result(column="game_platform", property="gamePlatform", jdbcType=JdbcType.BIGINT),
    })
    List<FtBetRecordSpec> getRewardRecord(@Param("userId")Long userId, @Param("gameKind")Long gameKind,@Param("datetime")Date datetime);

    @SelectProvider(type=FtBetRecordExtendSqlProvider.class, method="getRewardRecord2")
    @Results({
            @Result(column="BETSUM", property="betAmount", jdbcType=JdbcType.DECIMAL),
            @Result(column="game_id", property="gameId", jdbcType=JdbcType.BIGINT),
    })
    List<FtBetRecordSpec> getRewardRecord2(@Param("userId")Long userId, @Param("gameKind")Long gameKind,@Param("datetime")Date datetime);

    @SelectProvider(type=FtBetRecordExtendSqlProvider.class, method="getSumBet")
    BigDecimal getBetSum(@Param("userId")Long userId);


}
